package com.sxt.service;

import java.util.List;

import com.sxt.entity.Book;

/**
 * 查找书
 * 
 * @author LiangJie
 *
 */
public class SimpleBookListImpl implements IBookList {
	IBookFinder finder = null;

	public void setFinder(IBookFinder finder) {
		this.finder = finder;
	}

	@Override
	public Book find(String name) {
		List<Book> list = finder.findAll();
		System.out.println(list);
		for (Book book : list) {
			if (book.getName().equals(name)) {
				return book;
			}
		}
		return null;
	}
}
